Fixed profile loading code