Added required type casting.
Added missing docustrings.