Reworked rc.local functions
Fixed issues with rc.local