Array casting optimization and RSpec updates.