Fixes to registerProvider method