should fix 1, 2 and 4 of #15