fixing footer error and some minor optimizations

Signed-off-by: Markus Jura <markus.jura@googlemail.com>