Minor fixes

Change two PHP short tags (<?) to standard PHP start tag (<?php) so the plugin works on servers that don't support PHP short tags.

Also fixed two minor bugs