Fixed #65, #64; worked on #44, #39