Fixed some minor bugs
Merge origin/master