Fixed template errors and added facebook support