Add code for shortcuts and fix a couple of bugs