Added checkbox handling. Need to check for array in template tough.