Full source file
Fix minor bugs