Issues #56 and #57 fixed