fixes in automodapi.py prompted by tests
fixes in automodapi.py prompted by tests

StuartLittlefair/astropy,mhvk/astropy,saimn/astropy,saimn/astropy,astropy/astropy,tbabej/astropy,pllim/astropy,joergdietrich/astropy,astropy/astropy,mhvk/astropy,joergdietrich/astropy,MSeifert04/astropy,funbaker/astropy,pllim/astropy,pllim/astropy,larrybradley/astropy,aleksandr-bakanov/astropy,mhvk/astropy,bsipocz/astropy,funbaker/astropy,saimn/astropy,astropy/astropy,aleksandr-bakanov/astropy,funbaker/astropy,aleksandr-bakanov/astropy,MSeifert04/astropy,lpsinger/astropy,DougBurke/astropy,kelle/astropy,bsipocz/astropy,joergdietrich/astropy,DougBurke/astropy,lpsinger/astropy,saimn/astropy,joergdietrich/astropy,dhomeier/astropy,tbabej/astropy,StuartLittlefair/astropy,larrybradley/astropy,lpsinger/astropy,tbabej/astropy,bsipocz/astropy,saimn/astropy,kelle/astropy,AustereCuriosity/astropy,stargaser/astropy,larrybradley/astropy,pllim/astropy,stargaser/astropy,astropy/astropy,tbabej/astropy,pllim/astropy,MSeifert04/astropy,astropy/astropy,AustereCuriosity/astropy,lpsinger/astropy,DougBurke/astropy,funbaker/astropy,mhvk/astropy,StuartLittlefair/astropy,lpsinger/astropy,StuartLittlefair/astropy,bsipocz/astropy,tbabej/astropy,stargaser/astropy,AustereCuriosity/astropy,larrybradley/astropy,StuartLittlefair/astropy,AustereCuriosity/astropy,kelle/astropy,joergdietrich/astropy,stargaser/astropy,dhomeier/astropy,aleksandr-bakanov/astropy,mhvk/astropy,MSeifert04/astropy,AustereCuriosity/astropy,kelle/astropy,dhomeier/astropy,dhomeier/astropy,kelle/astropy,larrybradley/astropy,DougBurke/astropy,dhomeier/astropy