fix minor warning
Fix some exceptions to throw