Bugfixes to bit template