Fix few issues that were pointed out in the comments