Removed templates

All operators are overloaded with explicit types to avoid weird compiler
error messages when using integer.

Fixed a few bugs. Probably added a few too.