Several minor bugs resolved