Fix the bugs appeared after last PR

I would strongly suggest against using a different indentation level than the standard one. Please use 1 space for the license header.