Fixed interface issues and memory crash.

Fixed interface issues and memory crash.