small fixes and bugs
finished fixing bugs