Fixing code style errors, lack of comments etc.