Fixes for BCS-460 and code cleanup