Fixed NullReference exception.