Update shorten.php

Minor tweaks to eliminate PHP notices and warnings.