Fixed template switch
Fixed empty template fields
Added datefilter which is compatible with MySQL dates