fixes possible system.register bug

This is a possible bug with System.register. It needs a bit more investigating and testing.