#16 fixed bug with casting a boolean to an index