Fixed workarounds and moved everything into a shell script