Fixed #18, #15, #16