fixes some simple bugs