Cleaned-up code

Some small fixes.