Fixes to reported bugs