Repairing bugs

Some simple bugs to repair