Added support for interfaces + various bugfixes