fixed errors

Thanks to Zac Mitton for pointing out some errors.