Small fixes

Just some small fixes (was previously #314)

Updated common.php to rtrim index.php instead of common.php as an error was produced during installation where BASE_PATH wasn't defined.

Added a slash to working directory in else clause in download.php

Added an empty check on data, as described in #209 - init was attempting to pass an entirely empty data value to jsend resulting in an error.