Insomnis: Bugs solved

Several bugs fixed.