Edit: Formatting. Also fixed type checks in edit functions. Apparently sqlite does not actually enforce type checking. Go figure.