Bug fixes

sooo many bugs