fixed issues: #1, #2, #3, #4, #5, #7, #10, #11, #12, #14, #17