Bug fixes on returned parameters