Remove unnecessary usage of Serializable to fix a permission issue.

This are the only 2 places where we use Serializable and a headless server
log file contained exactly 2 permission violations about Serializable.