Resolved a few minor bugs