Fixes for silly bugs