Update gem application support.

They are small fixes.
There is no side effect to environments that don't use gem applications.