Fix bugs with jade templates