Fixed #18 and #12