Make error message for wrong input dim more explicit
Add comments to different conditional paths