Fixed #42, #53, #54 and #55