Bug Fix

Fixed general bugs