fixes #165 2b and 4a and 4b