Fixed compilation problems that occured when choosing other parameters t...

...han the default ones. Cleaned up the code a bit as well.