Dev bugfix.

- Fixed #3770, cleaned related code.