Further cleanup and debian wheezy support, picked from @coderfi 's branch, thanks!