Changed som references to pointers. Added two getters to LR config. Added some more error checks if DEBUG is set