Added bugfixes and unbind functionality