Fixed date and template bugs
Fix #44
Fixed encoding bug