Template corrections, added user functions, color changes