fixed some things like @fgrehm suggested