Fixed #52 and #35