Added basic palette functions.
Fixed a bug with redundant text field capture.