Fixed #20
minor bugs