Fixed #46 and #45