Added shebang line and changed a variable name.

Signed-off-by: Stefan Tatschner <stefan@sevenbyte.org>
Removed a debugging print.

Signed-off-by: Stefan Tatschner <stefan@sevenbyte.org>
Fixed some bugs, improved output.

Signed-off-by: Stefan Tatschner <stefan@sevenbyte.org>