Fixed #20 and #24