Fixed bug with bounds fn