Fixed potential bugs on dynamic table view controller