Fixed old and deprecated code

See #4