This should fix #3, #5, #6, #13, #15, not all have been tested.