Added throw runtime exception instead of assertion for whole lib.