Finishing template some small bug fixes