Fixed #144 and other small issues