Fixes #276 #277