Changed convert API for flexibility
Fixed NPE