Fixes for issues #146 and #144

Please see issues #146 and #144 for details.