Fix 'Cancel' button functionality

Closes #50