Fixes bugs in develop branch