fix issue #22
fix issue #44...sort of
fix issue #43
merge dev