Error fixes for #2