Some minor bug tweaking