Bug fixes, added defaults to arguments