Added in some bug fixes.