Fixed #1, #3, #4